<?php

//php7 以前=============
 class A{
    public $x=2;
 }
 $fund=function(){
    return $this->x;
 };

 $newfunc=$fund->bindTo(new A,'A');
 echo $newfunc();
//php7+ =============
 class B{
   public $x=2;
}
 $dunx2=function(){return $this->x+2;};
 echo $dunx2->call(new B);